//
// Created by amon.huang on 2021/7/26.
//

#ifndef AMONPLAYER_PACKETQUEUE_H
#define AMONPLAYER_PACKETQUEUE_H

#include <queue>
#include <pthread.h>

#ifdef __cplusplus
extern "C" {
#endif
#include <libavcodec/avcodec.h>
#ifdef __cplusplus
}
#endif

class PacketQueue {
public:
    std::queue<AVPacket *> *pPacketQueue;
    pthread_mutex_t packetMutex;
    pthread_cond_t packetCond;

public:
    PacketQueue();

    ~PacketQueue();

    void push(AVPacket *pPacket);

    AVPacket *pop();

    void clear();
};


#endif //AMONPLAYER_PACKETQUEUE_H
